-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to set assertions for values on the stack and assumptions for data placeholders #18
Conversation
Should fix #15 |
This is incomplete because no automatic tests are added yet. For now it just passes a few manual tests I've done, and seems to work. It might take a while until I find time to work on automatic tests, and meanwhile this might be interesting to those who wish to experiment with these assertions, so I'm putting this PR to public. @ajtowns you might want to check this out - IIRC you mentioned that something like this could be useful to you. I would appreciate any comments regarding the usefulness of this limited form of assertions and the ergonomics of their usage. Later, #14 can be resolved by using assertions to place constraints on args of |
The format for the assertions is described in the updated README.md |
c333a18
to
ad2cac3
Compare
Added distinction between assumptions and assertions
The README section about assertions and assumptions is updated accordingly. No tests still. |
1af33b1
to
20beb06
Compare
Rebased on main, squashed. Started adding tests. |
It seems to be relatively easy to add an ability to use data placeholders and data references within assertions (like, Still, if someone can show how assertions that use data placeholders/references without any arithmetic on them might be practically useful enough to have them available in the "simplified assertions", I might consider adding this feature |
28aaa0d
to
d1e0071
Compare
By the way, using data references with asserts might be useful in another way, to refer to previous values on the stack, like this:
Since it has obvious practical value, I have added this feature ( |
d1e0071
to
c32b11c
Compare
Added tests. |
Values on top of the stack can be constrained with assertions Data placeholders can be constrained with assumptions
0fe4573
to
0b6506b
Compare
Added ability to apply assertions to witnesses: Can be used to ensure that restrictions that the script put on its witnesses are as expected |
No description provided.